    <!DOCTYPE html>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>个人中心</title>
        <script src="js/jquery-3.5.1.min.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript" src="js/vue.js"></script>
        <script type="text/javascript" src="js/jquery.cookie.js"></script>
        <script type="text/javascript" src="js/bootstrap.js"></script>
        <link rel="stylesheet" href="css/bootstrap.css">
    </head>
    <body>
    <div id="outter">
        <a class='btn'  @click='nearsay'>获取附近人的留言(空间)</a>
<!--        <a class='btn'  @click='attentionsay'>关注人的留言(空间)</a>-->
<!--        <a class='btn'  @click='saytoall'>自己留言(空间)</a>-->
        <table  v-if="messages.length!=0" class="table text-center table-bordered table-hover table-striped bg-info">
            <thead>
            <tr>
                <td >昵称(可点击查看信息)</td>
                <td >时间</td>
                <td >图片</td>
                <td >文字</td>
                <td >点赞数</td>
                <td >看他信息</td>
                <td >点赞</td>
                <td >关注他</td>
            </tr>
            </thead>
               <tr   v-for="message in messages" class="tr-data" >
                <td v-text="message.nickName"></td>
                <td v-text="message.invitationTime"></td>
                <td v-text="message.imgSrc"></td>
                <td v-text="message.content"></td>
                <td v-text="message.votes"></td>
                <td >   <a class='btn'  :href="'coachinfo.html?userId='+userId+'&coachId='+message.userId " >看他信息</a></td>
                <td >   <a class='btn'  >点赞</a></td>
                <td >   <a class='btn'  >关注他</a></td>



            </tr>
        </table>

    </div>






    <script type="text/javascript">
        var zullstr="http://192.168.10.58:11000/user-coach/"
        var strurl=location.href;
        var userId=strurl.split("=")[1];
        var app=new Vue({
            el:"#outter",
            data:{
                length_to:"2",
                userId:"",
                messages:[]
            },
            created:function(){
                _this=this;
            },

            methods:{

                nearsay:function(){
                    $.ajax({ beforeSend: function (request) {
                            request.setRequestHeader("auth_token", $.cookie("auth_token"));},
                        url:zullstr+"invitation/getaroundpersoninvitation",
                        type:"post",
                        data:{"userId":_this.userId,"distance":_this.length_to},
                        success:function(data){
                          _this. messages=data.data;
                        }
                    });
                },
                seesee:function (userId) {
                       window.location.href="coachinfo.html?"+"userId="+userId;
                }


        }

        })

    </script>
    </body>
    </html>